﻿using System;
using System.Diagnostics;
using System.Text;

namespace 面向对象练习1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Pubcc a = new Pubcc("ta",-18,'a');
            //a.sss();
            //将string类型看做是char类型的一个只读类型
            //string a = "abcdef";
            //a[0] = 'b'; 这样写不行因为它是只读
            //首先将字符串转成cher类型的数组
            //char[] chs= a.ToCharArray();
            //chs[0] = 'b';
            //将字符数组转换成字符串类型
            //a =new string(chs);
            //Console.WriteLine( a[0]);
            //Console.WriteLine(a);
            StringBuilder sb = new StringBuilder();
            //string str = null;
            //创建一个计时器，用来记录程序运行的时间
            Stopwatch sw = new Stopwatch();
            sw.Start();
            for (int i = 0; i < 100000; i++)
            {
                sb.Append(i);
            }
            sw.Stop();
            Console.WriteLine(sb.ToString());
            Console.WriteLine(sw.Elapsed);
            Console.ReadKey();
        }
    }
}
